package com.freedy.dataStructure.tree;


/**
 * @author Freedy
 * @date 2021/3/23 20:36
 */
public class Test {
    public static void main(String[] args) {
//        int[] arr={4,3,6,5,7,8};
//        int[] arr={10,12,8,9,7,6};
        int[] arr={10,11,7,6,8,9};
        AVLTree tree = new AVLTree(arr[0]);
        for (int i = 1; i < arr.length; i++) {
            tree.add(arr[i]);
        }
        tree.print(TreeEnum.infixOrder);
        System.out.println("===========树的高度============");
        System.out.println("当前树的高度:"+tree.height(TreeEnum.height));
        System.out.println("当前树的左子树的高度:"+tree.height(TreeEnum.leftHeight));
        System.out.println("当前树的右子树的高度:"+tree.height(TreeEnum.rightHeight));
    }
}
